export class Player {
    public readonly connectionId: string;
    public x: number;
    public y: number;

    constructor(connectionId: string) {
        this.connectionId = connectionId;
        this.x = 0;
        this.y = 0;
    }

    public move(direction: string): void {
        switch (direction) {
            case 'up':
                this.y--;
                break;
            case 'down':
                this.y++;
                break;
            case 'left':
                this.x--;
                break;
            case 'right':
                this.x++;
                break;
        }
    }
} 